<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		输入一个数：<input type="text" id="input1" />
		<button onclick="check()">计算</button>
		<script>
		function check()
		{
			var n=input1.value,i,a
			i=0;
			for(a=1;a<=n;a++){
				i=a+i
			}
			alert(+i);
		}
		</script>
	</body>
</html>
